import java.io.PrintStream;
import java.util.Scanner;

/**
 * resolve o problema: 701 - The Archeologists' Dilemma
 * @author Jonas Jeske www.inf.ufrgs.br/~jjeske
 *
 */
public class Main {
	
	public static void main(String[] args){
		Main theArchDilemma = new Main();
		theArchDilemma.begin();
	}

	/*
	 * Sample Input  

1
2
10


Sample Output  

7
8
20


	 */
	private void begin() {
		Scanner entrada = new Scanner(System.in);
		PrintStream saida = new PrintStream(System.out);
		long input;
		long output;
		
		while(entrada.hasNext()){
			input = entrada.nextLong();
			output = solve(input);
			if(output != 0){
				saida.printf("%d\n",output);
			} else {
				saida.printf("no power of 2\n"); //TODO check the \n
			}						
		}
	}

	private static long solve(long input) {
		int N = (String.valueOf(input)).length(); //tamanho do input
		
		double minimo = 0;
		double maximo = 5;
		
		double log_two = log2(10); //esse valor eh constante!
		
		int resultado;
		
		while(true){
			N++;
			
			//log2(X*(10^N)) = log2(X) + log2(10)*N			
//			minimo = log2(input*(Math.pow(10, N)));
//			maximo = log2((input+1)*(Math.pow(10, N)));
			
			minimo = (int) (log2(input) + (log_two*N));
			maximo = (int) (log2(input+1) + (log_two*N));
			
            resultado = (int) Math.ceil(minimo);//  (ceil(minimo));
            if(resultado < maximo)
            {   
            	return resultado+1;
            }
			
			
//			System.out.println(minimo);
//			System.out.println(maximo);
//			System.out.println("diferenca max-min: " + (maximo-minimo));
//			System.out.println("jonas");
            
            
            
			
	
		}
		
		//isso tudo deu TIMEOUT !! troquei pelo CEIL !! Java rocks!
		
//		//System.out.println("N = " + N);
//		N = N + (String.valueOf(input)).length(); //tamanho do input
//		//System.out.println("part1 + part2 = " + N);
//		
//		int i = 7; //eh o valor minumo para 1.
//		while(true){ //32,767
//
//			//Starts with !! Nessa o Java matou a pau !
////			if( (String.valueOf( (int) (Math.pow(2, i))).length() == N) &&
////				(String.valueOf( (int) (Math.pow(2, i)))).startsWith(String.valueOf(input))) {
////				return i;
////			}
//			
//			if( (String.valueOf( potencia2(i) ).length() == N) &&
//			    (String.valueOf( potencia2(i) ).startsWith(String.valueOf(input))) ) {
//			return i;
//		}			
//			i++;
//		}
		}
	
	/*
	 * realiza o calculo de logaritmo base 2 !
	 * retorna o valor truncado !
	 */
	private static double log2(double num)
		{
			return (Math.log(num) / Math.log(2));
		}
	
	/**
	 * retorna o long de uma potencia de 2
	 * @param p
	 * @return
	 */
	private static long potencia2(long p){
		long acumulador = 1;
		for(long i=0;i<p;i++){
			acumulador = 2 * acumulador;
		}
		return acumulador;	
	}


}
